﻿<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" lasteditedby="Geert" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
  <title translate="true">Saving objects</title>
  <keywords>
    <keyword translate="true">ModelBase</keyword>
  </keywords>
  <body>
    <header>
      <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Saving objects</text></para>
    </header>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">Saving and loading objects out of the box has never been so easy. </text><link displaytype="text" defaultstyle="true" type="topiclink" href="T_Catel_Data_SavableModelBase" styleclass="Normal" translate="true">SavableModelBase</link><text styleclass="Normal" translate="true"> can automatically save/load objects in several ways, such as memory, file in different modes (binary and XML). This example shows that making your objects savable is very easy and does not take any time!</text></para>
    <para styleclass="Heading2"><text styleclass="Heading2" translate="true">Code snippets</text></para>
    <list id="2" type="ul" listtype="bullet" formatstring="·" format-charset="SYMBOL_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Normal (list)" style="font-family:Symbol; font-size:10pt; color:#000000;">
      <li styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">model - Declare a model based on the ModelBase class</text></li>
      <li styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">modelprop - Declare a simple property on a model</text></li>
    </list>
    <para styleclass="Heading2"><text styleclass="Heading2" translate="true">Steps</text></para>
    <list id="3" type="ol" listtype="decimal" formatstring="%0:s." format-charset="DEFAULT_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Normal (list)" style="font-family:Arial; font-size:10pt; color:#000000;">
      <li styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Create a new class file called </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Person.cs</text><text styleclass="Normal (list)" translate="true">.</text></li>
      <li styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Inside the namespace, use the </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">model</text><text styleclass="Normal (list)" translate="true"> codesnippet and fill in the name of the class, in this case </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Person</text><text styleclass="Normal (list)" translate="true">.</text></li>
      <li styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Change the base class from </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">ModelBase</text><text styleclass="Normal (list)" translate="true"> to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">SavableModelBase</text><text styleclass="Normal (list)" translate="true">.</text></li>
      <li styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">In the </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Properties</text><text styleclass="Normal (list)" translate="true"> region, use the code snippet </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">modelprop</text><text styleclass="Normal (list)" translate="true">, and use the following values:</text></li>
    </list>
    <para styleclass="Normal"><table styleclass="Default" rowcount="5" colcount="2">
      <tr style="vertical-align:top">
        <td style="width:227px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Code snippet item</text></para>
        </td>
        <td style="width:458px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Value</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:227px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">description</text></para>
        </td>
        <td style="width:458px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Gets or sets the name</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:227px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">type</text></para>
        </td>
        <td style="width:458px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">string</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:227px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">name</text></para>
        </td>
        <td style="width:458px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Name</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:227px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">defaultvalue</text></para>
        </td>
        <td style="width:458px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">&quot;MyName&quot;</text></para>
        </td>
      </tr>
    </table></para>
    <list id="3" type="ol" listtype="decimal" formatstring="%0:s." format-charset="DEFAULT_CHARSET" levelreset="true" legalstyle="false" startfrom="1" styleclass="Normal (list)" style="font-family:Arial; font-size:10pt; color:#000000;">
      <li styleclass="Normal (list)"><text styleclass="Normal" translate="true">You can now save the created object by using any of the </text><text styleclass="Normal" style="font-style:italic;" translate="true">Save</text><text styleclass="Normal" translate="true"> methods. Loading can be done by using the static </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Person</text><text styleclass="Normal" style="font-style:italic;" translate="true">.Load</text><text styleclass="Normal" translate="true"> methods.</text></li>
    </list>
    <para styleclass="Heading2"><text styleclass="Heading2" translate="true">Code</text></para>
    <para styleclass="Code Example"><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Person</text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true"> class which fully supports serialization, property changed notifications,</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// backwards compatibility and error checking.</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;/summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">[Serializable]</text><br/><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">public</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">class</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Person</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">:</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">SavableModelBase&lt;Person&gt;</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">{</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#region Fields</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#endregion </text><br/><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#region Constructors</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// Initializes a new object from scratch.</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;/summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">public</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Person()</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">{</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">}</text><br/><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// Initializes a new object based on &lt;see cref=&quot;SerializationInfo&quot;/&gt;.</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;/summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;param name=&quot;info&quot;&gt;&lt;see</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">///     cref=&quot;SerializationInfo&quot;/&gt; that contains the information.</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;/param&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;param name=&quot;context&quot;&gt;&lt;see</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">//       cref=&quot;StreamingContext&quot;/&gt;.&lt;/param&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">protected</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Person(SerializationInfo</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">info,</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">StreamingContext</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">context)</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">        </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">:</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">base</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">(info,</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">context)</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">{</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">}</text><br/><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#endregion </text><br/><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#region Properties</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// Gets or sets the name.</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;/summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">public</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">string</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Name</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">{</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">        </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">get</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">{</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">return</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">GetValue&lt;</text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">string</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">&gt;(NameProperty);</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">}</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">        </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">set</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">{</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">SetValue(NameProperty,</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">value);</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">}</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">}</text><br/><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// Register the Name property so it is known in the class.</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:italic; color:#000000;" translate="true">/// &lt;/summary&gt; </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">public</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">static</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">readonly</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">PropertyData NameProperty</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">=</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">RegisterProperty(&quot;Name&quot;,</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">typeof</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">(</text><text styleclass="Code Example" style="font-weight:bold; font-style:normal; color:#000000;" translate="true">string</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">),</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">&quot;MyName&quot;);</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#endregion </text><br/><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#region Methods</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">    </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">#endregion </text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">}</text></para>
    <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Loading an object</text></para>
    <para styleclass="Normal"><text styleclass="Normal" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Loading an object is really simple once the class has been created. It is important to use the static method on the class:</text></para>
    <para styleclass="Code Example"><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">var</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">person</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true"> </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">=</text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#ffffff;" translate="true">  </text><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">Person.Load(@&quot;c:\person.dob&quot;);</text></para>
    <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Saving an object</text></para>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">To save an object, an instance is required. Then simply call the </text><text styleclass="Normal" style="font-style:italic;" translate="true">Save</text><text styleclass="Normal" style="font-style:normal;" translate="true"> method.</text></para>
    <para styleclass="Code Example"><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">var person = new Person();</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">person.Name = &quot;John Doe&quot;;</text><br/><text styleclass="Code Example" style="font-weight:normal; font-style:normal; color:#000000;" translate="true">person.Save(@&quot;c:\person.dob&quot;);</text></para>
  </body>
</topic>
